package test.core.data;

import java.io.File;
import java.util.HashMap;
import hyl.core.io.MyFile;


public class MySerialtest2 {

	
	static String 序列化文件名="d:/test/hyl.zf";
	//加密
	public static void main(String[] args)  {
		加密() ;
		解密() ;
		
	}
	
	public static void 加密()  {
		
		HashMap hm=new HashMap<String,String>();
		hm.put("appid", "12355966969");
		hm.put("appsec", "12355966969");
		hm.put("公司名称", "12355966969");
		hm.put("创建日期", "12355966969");
		hm.put("到期日期", "12355966969");
		//MyPath.test(MyConfig.class);
		
	    File f=MyFile.openFile(序列化文件名);	
		MySerial.serialize(hm, f);
		System.out.println("序列化完成"+hm.toString());
		
	}
	public static void 解密()  {
		
		HashMap hm=new HashMap<String,String>();
		//MyPath.test(MyConfig.class);
	
	    File f=MyFile.openFile(序列化文件名);	
	    hm=(HashMap<String,String>)MySerial.deserialize(f);
		System.out.println("反序列化完成"+hm.toString());
		
	}
}
